# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=plcscan
pkgver=0.1
pkgrel=6
groups=('blackarch' 'blackarch-scanner' 'blackarch-networking')
pkgdesc='This is a tool written in Python that will scan for PLC devices over s7comm or modbus protocols.'
arch=('any')
url='http://packetstormsecurity.com/files/119726/PLC-Device-Scanner.html'
license=('custom:unknown')
depends=('python2')
source=("https://dl.packetstormsecurity.net/UNIX/utilities/$pkgname.tgz")
sha512sums=('a27e0882eeeb63c7cbdee295c91d0fdf3847ae314f8b10d1fe222ad9d5668295e0622a9608cd0a0914a277080509c7a1679bc9cb95ca96c13506be3a920c605e')

package() {
  cd plcscan-read-only

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/$pkgname/" *.py

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec python2 /usr/share/$pkgname/$pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

